var App = (function(App, $, _){

	'user strict';

	var ticket = {};
	var moduleName = "river"; // define a unique module name

	/* ==== PLACE MODULE CODE HERE ==== */
	var sender = false;

	ticket.changed = function(e) {
		var ticketValue = JSON.parse(e.message);
		if(sender === false) {
			$("#ticket").val(ticketValue);
		} else {
			sender = false;
		}
	};

	// a public method example
	ticket.change = function() {
		gapi.hangout.data.sendMessage(JSON.stringify({ticketValue: $("#ticket").val()}));
		sender = true;
	};

	// default initialisation method (called when API and DOM are ready)
	ticket.init = function() {
		$("#ticket").keyup(ticket.change);
		gapi.hangout.data.onMessageReceived.add(ticket.changed);
	};

	/* ================================ */

	// add module to list of modules
	App.modules = App.hasOwnProperty("modules") ? App.modules : {};
	App.modules[moduleName] = ticket;

	return App;

}(App || {}, $, _));